import Vue from "vue";
import VueRouter from "vue-router";
import VueMirror from "../source";
import codeblock from "./components/codeblock"
import document from "./components/document"
import func from "./components/function"

import Home from "./page/Home.vue";

import MButton from "./page/MButton.vue";
import MRadio from "./page/MRadio.vue";
import MCheckbox from "./page/MCheckbox.vue";
import MForm from "./page/MForm.vue";

import MModal from "./page/MModal.vue";
import MToast from "./page/MToast.vue";

Vue.use(VueRouter);
Vue.use(VueMirror);
Vue.use(codeblock);
Vue.use(document);
Vue.use(func);

const routes = [
    { path: '/Home', component: Home },

    { path: '/MButton', component: MButton },
    { path: '/MRadio', component: MRadio },
    { path: '/MCheckbox', component: MCheckbox },
    { path: '/MForm', component: MForm },

    { path: '/MModal', component: MModal },
    { path: '/MToast', component: MToast }
]

const router = new VueRouter({
    routes
})

const app = new Vue({
    router
}).$mount('#app')

if (location.href.charAt(location.href.length - 1) == "/") {
    router.replace("Home");
}